package com.mtsmda;

import java.util.List;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

@XmlRootElement
@XmlType(propOrder = { "countryName", "countryPopulation", "states" })
public class Country {

	private String countryName;
	private Double countryPopulation;
	private List<State> states;

	public Country() {
		super();
	}

	public Country(String countryName, Double countryPopulation,
			List<State> states) {
		this();
		setCountryName(countryName);
		setCountryPopulation(countryPopulation);
		setStates(states);

	}

	public String getCountryName() {
		return countryName;
	}

	@XmlElement
	public void setCountryName(String countryName) {
		this.countryName = countryName;
	}

	public Double getCountryPopulation() {
		return countryPopulation;
	}

	@XmlElement
	public void setCountryPopulation(Double countryPopulation) {
		this.countryPopulation = countryPopulation;
	}

	public List<State> getStates() {
		return states;
	}

	@XmlElementWrapper(name = "states")
	@XmlElement(name = "state")
	public void setStates(List<State> states) {
		this.states = states;
	}

	@Override
	public String toString() {
		return "Country [countryName=" + countryName + ", countryPopulation="
				+ countryPopulation + ", states=" + states + "]";
	}

}